import chardet
def encodeingcheck(file):
    f = open(file,'rb')
    data = f.read()
    result= chardet.detect(data)
    return result.get('encoding')
if __name__ == "__main__":
    print(encodeingcheck("db.txt"))